#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

class Solution {
public:
    void rotate(vector<int>& nums, int k) {
        for(int i=0;i<k;++i){
            int temp =nums.back();
            nums.pop_back();
            nums.insert(nums.begin(),temp);
        }
    }
};

int main(){
    Solution S;
    vector<int> nums = {1,2,3,4,5,6,7};
    S.rotate(nums,3);
    return 0;
}